<template>
  <van-swipe :autoplay="3000" lazy-render class="swiper">
  <van-swipe-item v-for="(image,index) in imgList.images" :key="index" class="swiper-item">
    <img :src="image.imageUrl" />
  </van-swipe-item>
</van-swipe>
</template>

<script>
import {reactive,onMounted} from 'vue'
import {getBanner} from '@/axios/api/home.js'
export default {
setup(){
      let imgList=reactive({
      images:[]
    })
    
    onMounted( async ()=>{
    let res = await getBanner()
    if(res.data.code==200){
      // console.log(res)
      imgList.images = res.data.banners

    }
    })

     return { imgList };
}
}
</script>

<style lang="less">
.swiper{
   width:95%;
   margin-top:.3rem;
   margin-left:.2rem;
  //  border: 0.01rem solid #a19f9f;
   .van-swipe__track{
       .van-swipe-item {
   img{
       width:100%;
       height:3.6rem;
   }
       }
   }
  
}
</style>